#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<string>
using namespace std;

class Solution {
public:
    bool canConstruct(string ransomNote, string magazine) {
        int hash[26] = { 0 };
        for (auto e : magazine) {
            hash[e - 'a']++;
        }
        for (auto e : ransomNote) {
            hash[e - 'a']--;
            if (hash[e - 'a'] < 0) return false;
        }
        return true;
    }
};

class Solution {
public:
    int bulbSwitch(int n) {
        return sqrt(n);
    }
};